Secured FTP (SFTP) Library Object
From version 7.3, Real-Time Designer has a new built-in library type, SFTP.
The SFTP library type and associated functions enable you to upload, download, and manage files on one or more SFTP servers.
The business entities in this library are exposed under Business Entities > Library Types > Communication> SFTP.
The functions are exposed under Project > References > Library References > Direct.Common > SFTP.
For more information about working with SFTP functions, see Using SFTP Functions.
Before using the SFTP functions, create an instance of the SFTP business entity. Set the initial values for each of the following SFTP instance properties so that you can connect to the SFTP server.
Name |
Input Type |
Description |
---|---|---|
Host | Text | The host name of the SFTP server. |
Password |
Text |
The password for connecting to the SFTP server. |
Port |
Number |
The port for connecting to the SFTP server. |
User Name | Text | The username for connecting to the SFTP server. |
Before you use the SFTP functions, make sure that:
-
The SFTP instance contains the correct parameter values.
-
You are connected to the SFTP server (except for the Connect function).
The functions of SFTP library are listed below:

Connects to an SFTP server.
Parameter | Input | Description |
---|---|---|
SFTP Object | SFTP Object |
An SFTP business entity that has established a connection with the SFTP server. |
Returns
Returns the success or error message as a text value. These messages are also populated in logs for troubleshooting, as mentioned in the Maintenance and Troubleshooting Guide.

Disconnects from a connected SFTP server.
Parameter | Input | Description |
---|---|---|
SFTP Object | SFTP Object |
An SFTP business entity that has established a connection with the SFTP server. |
Returns
Returns the success or error message as a text value. These messages are also populated in logs for troubleshooting, as mentioned in the Maintenance and Troubleshooting Guide.

Copies a list of files from source SFTP folder to a target SFTP folder. If there are existing files with the same name(s) in the target directory, they will be replaced with the transferred file(s).
Parameter | Input | Description |
---|---|---|
File Name | List of Text |
The names of the files to be copied, including the file extensions. |
Source Path |
Text |
The path to the SFTP folder from which to copy the files. |
Target Path |
Text |
The path to the SFTP folder to which to copy the files. |
SFTP Object | SFTP Object |
An SFTP business entity that has established a connection with the SFTP server. |
Returns
Returns the success or error message as a text value. These messages are also populated in logs for troubleshooting, as mentioned in the Maintenance and Troubleshooting Guide..

Deletes a list of files from a specified SFTP folder.
Parameter | Input | Description |
---|---|---|
File Name | List of Text |
The names of the files to be deleted, including the file extensions. |
Folder Path |
Text |
The SFTP folder from which to delete the specified files. |
SFTP Object | SFTP Object |
An SFTP business entity that has established a connection with the SFTP server. |
Returns
Returns the success or error message as a text value. These messages are also populated in logs for troubleshooting, as mentioned in the Maintenance and Troubleshooting Guide.

Deletes all files with a specified extension from a specified SFTP folder, and optionally from all its subfolders.
Parameter | Input | Description |
---|---|---|
File Extension | Text |
The extension of the file type to delete. If the File Extension is empty, all the files in the specified folder will be deleted. |
Folder Path |
Text |
The SFTP folder from which to delete the files. |
SFTP Object | SFTP Object |
An SFTP business entity that has established a connection with the SFTP server. |
Include Subfolders |
Boolean |
Indicates if the files should be deleted from the specified folder and its subfolders (True), or only be from the specified folder (False). |
Returns
Returns the success or error message as a text value. These messages are also populated in logs for troubleshooting, as mentioned in the Maintenance and Troubleshooting Guide.

Downloads the specified files from an SFTP folder to a folder on the local machine.
Parameter | Input | Description |
---|---|---|
File Name |
List of Text |
The names of the files to be downloaded, including the file extensions. |
SFTP Object | SFTP Object |
An SFTP business entity that has established a connection with the SFTP server. |
Source Path |
Text |
The path to the SFTP folder from which to download the files. If the Folder Path is empty, all the files in the SFTP server's root directory will be downloaded. |
Target Path |
Text |
The path to the folder on the local machine to which to download the files. |
Returns
Returns the success or error message as a text value. These messages are also populated in logs for troubleshooting, as mentioned in the Maintenance and Troubleshooting Guide.

Downloads all files with a specified extension from a specified SFTP folder, and optionally from all its subfolders, to a folder on the local machine.
Parameter | Input | Description |
---|---|---|
File Extension | Text |
The extension of the file type to download. If the File Extension is empty, all the files in the specified folder will be downloaded. |
SFTP Object | SFTP Object |
An SFTP business entity that has established a connection with the SFTP server. |
Source Path |
Text |
The path to the SFTP folder from which to download the files. |
Include Subfolders |
Boolean |
Indicates if the files should be downloaded from the specified folder and its subfolders (True), or only be from the specified folder (False). If the Source Path contains a subfolder that is not present in the Target Path, the function creates the same folder structure in the Target Path before downloading the file. |
Target Path |
Text |
The path to the folder on the local machine to which to download the files. |
Returns
Returns the success or error message as a text value. These messages are also populated in logs for troubleshooting, as mentioned in the Maintenance and Troubleshooting Guide.

Fetches a list of file names along with file path present in the given SFTP folder.
Parameter | Input | Description |
---|---|---|
File Extension | Text |
The extension of the file type to list. If the File Extension is empty, all the files in the folder will be listed. |
SFTP Object | SFTP Object |
An SFTP business entity that has established a connection with the SFTP server. |
Folder Path |
Text |
The path of the SFTP folder from which to retrieve the file list. If the Folder Path is empty, all the files in the SFTP server's root directory will be listed. |
Include Subfolders |
Boolean |
Indicates if all files in the specified folder and its subfolders should be listed (True), or if only files from the specified folder should be listed (False). |
Returns
Returns the files list as list of text.

Uploads the files from a specified folder on the local machine to a specified SFTP folder.
Parameter | Input | Description |
---|---|---|
File Name |
List of Text |
The names of the files to be uploaded, including the file extensions. |
SFTP Object | SFTP Object |
An SFTP business entity that has established a connection with the SFTP server. |
Source path |
Text |
The path to the folder on the local machine from which to upload the files. |
Target Path |
Text |
The path to the SFTP folder to which to upload the files. |
Returns
Returns the success or error message as a text value. These messages are also populated in logs for troubleshooting, as mentioned in the Maintenance and Troubleshooting Guide.

Downloads all files with a specified extension from a specified local folder, and optionally from all its subfolders, to a specified SFTP folder.
Parameter | Input | Description |
---|---|---|
File Extension | Text |
The extension of the file type to upload. If the File Extension is empty, all the files in the folder will be uploaded. |
SFTP Object | SFTP Object |
An SFTP business entity that has established a connection with the SFTP server. |
Source Path |
Text |
The path to the folder on the local machine from which to upload the files. |
Include Subfolders |
Boolean |
Indicates if all files in the specified folder and its subfolders should be uploaded (True), or if only files from the specified folder should be uploaded (False). If the Source Path contains a subfolder that is not present in the Target Path, the function creates the same folder structure in the Target Path before uploading the file. |
Target Path |
Text |
The path to the SFTP folder to which to upload the files. |
Returns
Returns the success or error message as a text value. These messages are also populated in logs for troubleshooting, as mentioned in the Maintenance and Troubleshooting Guide.

Renames a file in the specified SFTP folder. The renamed file will always keep the original extension.
Parameter | Input | Description |
---|---|---|
Current File Name | Text |
The name of the files to be renamed, including the file extension. |
New File Name |
Text |
The new file name, without an extension. |
SFTP Object | SFTP Object |
An SFTP business entity that has established a connection with the SFTP server. |
Folder Path |
Text |
The SFTP folder in which the file to be renamed is found. |
Returns
Returns the success or error message as a text value. These messages are also populated in logs for troubleshooting, as mentioned in the Maintenance and Troubleshooting Guide.
Permission

Moves a list of files from a source SFTP folder to a target SFTP folder.
Parameter | Input | Description |
---|---|---|
File Name | List of Text |
The names of the files to be moved, including the file extensions. |
Source Path |
Text |
The path to the SFTP source folder from which to move the files. |
Target Path |
Text |
The path to the SFTP source folder to which to move the files. |
SFTP Object | SFTP Object |
An SFTP business entity that has established a connection with the SFTP server. |
Returns
Returns the success or error message as a text value. These messages are also populated in logs for troubleshooting, as mentioned in the Maintenance and Troubleshooting Guide.

Checks if the specified folder exists in the SFTP server.
Parameter | Input | Description |
---|---|---|
Folder Name | Text |
The name of the folder which you want to check if exists. |
Folder Path |
Text |
The path of the SFTP folder where you want to check the specified folder. |
SFTP Object | SFTP Object |
An SFTP business entity that has established a connection with the SFTP server. |
Returns
Returns the success or error message as a text value. These messages are also populated in logs for troubleshooting, as mentioned in the Maintenance and Troubleshooting Guide.

Checks if the specified file exists in the specified folder of the SFTP server.
Parameter | Input | Description |
---|---|---|
File Name | Text |
The name of the file which you want to check if exists. |
SFTP Path |
Text |
The path of the SFTP folder where you want to check the specified file. |
SFTP Object | SFTP Object |
An SFTP business entity that has established a connection with the SFTP server. |
Returns
Returns the success or error message as a text value. These messages are also populated in logs for troubleshooting, as mentioned in the Maintenance and Troubleshooting Guide.

Creates a folder in the specified location of the SFTP server.
Parameter | Input | Description |
---|---|---|
Folder Name | Text |
The name of the folder that you want to create. |
SFTP Location |
Text |
The path to the SFTP folder where you want to create the folder. |
SFTP Object | SFTP Object |
An SFTP business entity that has established a connection with the SFTP server. |
Returns
Returns the success or error message as a text value. These messages are also populated in logs for troubleshooting, as mentioned in the Maintenance and Troubleshooting Guide.